<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="priceList" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <h3>Price List</h3>
        <h:form id="form">
            <h:dataTable value="#{cc.attrs.priceList}" var="item">
                <h:column>
                    <f:facet name="header">ID</f:facet>
                    #{item.id}
                </h:column>
                <h:column>
                    <f:facet name="header">Name</f:facet>
                    <h:commandLink action="#{sessionBean.viewDescription}">
                        #{item.name}
                        <f:param name="id" value="#{item.id}"></f:param>
                    </h:commandLink>
                    
                </h:column>
                <h:column>
                    <f:facet name="header">Price</f:facet>
                    #{item.price}
                </h:column>
                <h:column>
                    <f:facet name="header">Count</f:facet>
                    #{item.count}
                </h:column>
                <h:column>
                    <f:facet name="header"></f:facet>
                    <h:commandLink action="#{sessionBean.addPurchaseItem}">Add
                        <f:param name="id" value="#{item.id}"></f:param>
                    </h:commandLink>

                </h:column>
            </h:dataTable>
        </h:form>
    </cc:implementation>
</html>